require.config({
    paths: {
        "jquery": "./js/jquery-1.9.1.min"
    },
    shim: {
        
    }
});

require(["jquery","./build/indexStruct"], function ($,indexStruct) {
	
	/*var data = {
		time:(new Date).toString(),
		list:[
		   {
			id: '1',
			username: 'whf',
			password:'123',
			age:'16'
		   } 
		  ]
   		};*/
	
	
	loadList();
	
	
});
function editUser(id){
	
}

function deleteUser(id){
	$.post('user/deleteUserById.action',{id:id},function(status){
		console.log(status);
		if(status="success"){
			loadList();
		}else{
			alert('删除失败');
		}
		
	});
}


function loadList(){
	require(["./build/indexStruct"], function (indexStruct) {
		$.post('user/getUserList.action',{},function(data){
			$("#indexStruct").html(indexStruct({list:data}));
		});
	});
}